<ul class="pagination" id="<%=id%>">
    <%if(style=="right"){%>
    <li><span>共<%=totalPage%>页<%=count%>条，每页<%=pageSize%>条</span></li>
    <%}%>
    <%if(p>1){%>
        <li class="prev"><a href="<%=baseUrl%>&p=<%=p-1%>">上一页</a></li>
    <%}else{%>
        <li class="prev"><span>上一页</span></li>
    <%}%>
    <%if(totalPage){%>
        <li><a href="<%=baseUrl%>&p=1">1</a></li>
    <%}%>
    <%if(p<5){%>
        <%for(var i=2;i<=totalPage;i++){%>
        <li><a href="<%=baseUrl%>&p=<%=i%>"><%=i%></a></li>
        <%if(i>5)break;%>
        <%}%>
    <%}%>
    <%if(p>=5){%>
        <li><span>...</span></li>
        <%if(p<totalPage-3){%>
            <%for(var i=p-2;i<=p+2;i++){%>
            <li><a href="<%=baseUrl%>&p=<%=i%>"><%=i%></a></li>
            <%}%>
        <%}else{%>
            <%for(var i=totalPage-5;i<=totalPage-1;i++){%>
            <li><a href="<%=baseUrl%>&p=<%=i%>"><%=i%></a></li>
            <%}%>
        <%}%>
    <%}%>
    <%if(p<totalPage-2){%>
        <li><span>...</span></li>
    <%}%>
    <%if(totalPage>5){%>
        <li><a href="<%=baseUrl%>&p=<%=totalPage%>"><%=totalPage%></a></li>
    <%}%>
    <%if(p<totalPage){%>
        <li class="next"><a href="<%=baseUrl%>&p=<%=p+1%>">下一页</a></li>
    <%}else{%>
        <li class="next"><span>下一页</span></li>
    <%}%>
    <%if(style=="left"){%>
    <li><span>共<%=totalPage%>页<%=count%>条，每页<%=pageSize%>条</span></li>
    <%}%>
</ul>